Force 2fa reauthentication#90559
Conversation
Introduce named constants for the two server-side 2FA-setup signals so the reauth middleware can detect them
Extend the Reauthentication middleware to recognize both server-side 2FA-setup signals - the "432 Need to set up 2FA" jsonCode and the `PolicyRequires2FA` exception (matched by type or title). Both signals route through the same reauth path the middleware already runs on 407: call Authenticate, which mints a fresh TYPE_TWO_FACTOR_SETUP token and stamps `needsTwoFactorAuthSetup` on the response. NewDot then receives an Onyx merge to update this flag, and the existing RequireTwoFactorAuthenticationOverlay renders.
…cessful re-authentication if 2FA setup is required.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
Closing in favor of the simpler approach agreed on in the Slack discussion The approach proposed in this PR aimed to enforce 2FA setup almost instantly, but at the cost of significant complexity. We're dropping this approach and instead accepting up to a ~2-hour delay (the NewDot authToken refresh cadence) before idle members see the 2FA setup overlay after the Domain Force 2FA toggle is enabled. This trade-off significantly reduces complexity and minimizes the maintenance surface area. We'll revisit this only if customer reports indicate the delay becomes a problem. Replacement PRs:
|
Explanation of Change
Fixed Issues
Part of #82379
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari